home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 24 / Mac Magazin and MacEasy Magazine CD - Issue 24.iso / Grafik & Text / Painter 4.0 / Painter 4.0 demo / Painter 4.0 demo.rsrc / STR#_15.txt < prev    next >
Text File  |  1996-01-05  |  6KB  |  307 lines

  1. value = umod(value*4);
  2.  
  3. in this example, the image is turned into 4 bands from black to white. This can be useful in creating wood patterns.
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. value = 1;
  62.  
  63. This example clears the selection to white.
  64.  
  65. value = 0;
  66.  
  67. This example sets the image to black.
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85. value = sqrt((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5));
  86.  
  87. This command creates a circular gradation with black in the center.
  88.  
  89.  
  90.  
  91. value = lerp(usin(x), usin(y), 0.5);
  92.  
  93. This command creates a simple halftone cell.
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103. red = pow(red, 0.7); green = pow(green, 0.7); blue = pow(blue, 0.7);
  104.  
  105. This command lightens the image using gamma correction.
  106.  
  107. mask = max(red, max(green, blue));
  108.  
  109. This command computes the brightest of the red, green, and blue channels (for each pixel) and stores it into the mask.
  110.  
  111. value = min(0.1, value);
  112.  
  113. This command limits the minimum luminance of an image to 0.1.
  114.  
  115. value = step(value + ynoise, 1);
  116.  
  117. This creates horizontal random stripes and thresholds the image, rendering it in a sketchy style.
  118.  
  119. value = xnoise;
  120.  
  121. This creates vertical random stripes in the image which vary in intensity.
  122.  
  123. value += noise*0.2 - 0.1;
  124.  
  125. In this example 20 percent noise is added to the lightness of the image, creating a stippled effect. This is hue-protected noise.
  126.  
  127. hue = y;
  128.  
  129. When running this example in a photograph, a spectrum of colors runs vertically through the image.
  130.  
  131. value = x;
  132.  
  133. When running this example in a white image, a left-to-right ramp from black to white is created.
  134.  
  135. value = usin(x*2);
  136.  
  137. In this example the parentheses are used to surround the single parameter to the usin function.
  138.  
  139. red = (green + blue) / 2;
  140.  
  141. In this example, the green component is added to the blue component of the image before being divided by two and then stored into the red component of the image.
  142.  
  143. hue = lerp(x, y, 0.5);
  144.  
  145. In this example, the pixel x and y positions are parameters to the lerp function. Note the use of parentheses to enclose the parameters.
  146.  
  147. red = 1; green = 0;
  148.  
  149. In this example, the statements are run sequentially. First the red component of the image is set to 1 (full red) and then the green component of the image is set to 0 (no green).
  150.  
  151. red /= green;
  152.  
  153. divides the green component of the image into the red component of the image.
  154.  
  155. blue *= green;
  156.  
  157. multiplies the green component of the image into the blue component of the image.
  158.  
  159. red -= noise;
  160.  
  161. subtracts noise from the red component of the image.
  162.  
  163. blue += green;
  164.  
  165. adds the green component of the image into the blue component of the image.
  166.  
  167. red = red / 2;
  168.  
  169. divides red by 2 and stores the result in the red component of the image
  170.  
  171. red = x * y;
  172.  
  173. multiplies the x and y location fractions of the pixel position within the image and stores the result in the red component of the image.
  174.  
  175. blue = hue - value;
  176.  
  177. subtracts the value component from the hue component of the image and stores the result into the blue component of the image.
  178.  
  179. blue = red + green;
  180.  
  181. adds the red and green components of the image and stores the result into the blue component of the image.
  182.  
  183. red = 1;
  184.  
  185. assigns the value 1 into the red component of the image. If the value of the right hand side expression of the assignment is outside the range 0 through 1, it is clipped onto range before storing.
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215. red = cc_red; green = cc_green; blue = cc_blue;
  216.  
  217. This example fills the selection with the current color.
  218.  
  219. c_black = 0;
  220.  
  221. This drops away the black plate for the background image behind the floater.
  222.  
  223. mask = 0.5 * max(c_cyan, max(c_magenta, c_yellow));
  224.  
  225. This command computes a 50% GCR black channel for the background image into the floating mask.
  226.  
  227. c_magenta = 0;
  228.  
  229. When operating on a floater, this sets the magenta component of the image behind the selection to zero.
  230.  
  231. red = c_cyan; green = c_magenta; blue = c_yellow; mask = c_black;
  232.  
  233. When you select all and option-click to float a whole copy of an image, this command lets you separate an image into process color.
  234.  
  235. c_value *= value;
  236.  
  237. Here the value component of the floater is multiplied into the value (brightness) of the image behind it.
  238.  
  239. c_saturation = value;
  240.  
  241. Here the value (brightness) of the floater is stored into the saturation component of the image beneath it.
  242.  
  243. c_hue = hue;
  244.  
  245. Here the hue of the floater is stored into the hue of the image beneath it.
  246.  
  247. c_mask = min(c_mask, mask);
  248.  
  249. Here, the mask of a floater is included in the image mask beneath it. Note: 0 mask means "inside".
  250.  
  251. c_red -= red; c_green -= green; c_blue -= blue;
  252.  
  253. In this example, the floater is subtracted from the image beneath it.
  254.  
  255. c_red *= red; c_green *= green; c_blue *= blue;
  256.  
  257. In this example, the floater is composited using multiply.
  258.  
  259. c_red = lerp(red, c_red, c_mask);
  260.  
  261. In this example, just the red part of the floater is dropped.
  262.  
  263. black = 0;
  264.  
  265. In this example, the black plate is dropped.
  266.  
  267. yellow = sqrt(yellow);
  268.  
  269. In this example, the yellow plate is increased considerably.
  270.  
  271. magenta -= 0.2;
  272.  
  273. In this example, twenty percent is subtracted from the magenta plate.
  274.  
  275. cyan += 0.1;
  276.  
  277. In this example, ten percent is added to the cyan plate.
  278.  
  279. value = 1 - value;
  280.  
  281. Running this example on a color photograph will create a negative look where the hue is preserved.
  282.  
  283. saturation = 0;
  284.  
  285. Running this example on a color photograph will convert it to grayscale.
  286.  
  287. red = 1; green = 0; blue = 0; hue = x;
  288.  
  289. In this example, the color is set up to pure red in the first three statements. The last statement varies hue across the image horizontally, creating a spectrum.
  290.  
  291. mask = blue * (1 - green);
  292.  
  293. In this example, the blue component of the image is multipled by the inverse of the green parameter and stores into the mask.
  294.  
  295. blue = noise;
  296.  
  297. In this example the blue component of the image is replaced noise ranging between 0 (no blue) through 1 (100% blue). Note that this has no effect on the red and green components.
  298.  
  299. green = 0.5;
  300.  
  301. In this example the green component of the image is replaced with a flat value of 50% green. Note that this has no effect on the red and blue components.
  302.  
  303. red = x;
  304.  
  305. In this example the red component of the image is replaced with a ramp going from 0 at left to 1 at right. Note that this has no effect on the green and blue components.
  306.  
  307.